<!doctype html>
<html>
<head>
<title>我的银行卡</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../addons/eso_sale/style/css/style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />

<meta name="mobileOptimized" content="width" />
<meta name="handheldFriendly" content="true" />
<meta http-equiv="Cache-Control" content="max-age=0" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
		<section class="main animated fadeInDown">
			<div class="main-box">
               
				<p class="rb-row"><input type="text" class="input" id="bankAccount" value="{$profile['realname']}" readonly style="background:#ccc" /></p>
				<p class="rb-row"><input type="text" placeholder="请输入您的银行名称" class="input" id="banktype" value="{$profile['banktype']}"/></p>
                <p class="rb-row"><input type="tel" placeholder="请输入您的银行卡号" class="input" id="bankcard" value="{$profile['bankcard']}"/></p>
				<p class="rb-row"><input type="text" placeholder="请输入您的支付宝账号，可不填" id="alipay" class="input" value="{$profile['alipay']}"/></p>
				<p class="rb-row"><input type="text" placeholder="请输入您的微信支付号码，可不填" id="wxhao" class="input" value="{$profile['wxhao']}"/></p>
				<div class="recommend-tips">
					<h6>提示</h6>
					<p>为了您能快速结佣请提供详细的开户行信息,如招商银行福州华林支行。</p>
				</div>
				<p class="rb-submit"><input type="button" value="保存" class="btn" id="J_saveCard"/></p>
			</div>
		</section>
<footer class="foot"><a>&copy; {$_W['account']['name']}</a></footer>

<script src="http://libs.baidu.com/jquery/1.7.1/jquery.min.js"></script>
<script src="../addons/eso_sale/style/js/com.js"></script>
<script>
//保存银行卡信息
$('#J_saveCard').live("click", function () {
			
	bankcard = $("#bankcard").val();
	banktype = $("#banktype").val();
	alipay = $("#alipay").val();
	wxhao = $("#wxhao").val();
	opp = "{$_GPC['opp']}";
	if (banktype == "") {
		TopBox.alert("请填写银行卡名称!");
		return;
	}
	if (bankcard == "") {
		TopBox.alert("请填写银行卡号码!");
		return;
	} else {
		
		$.ajax({
			type: "POST",
			url: "{php echo $this->mturl('bankcard',array('op'=>'edit'))}",
			data: { 'bankcard': bankcard, 'banktype': banktype, 'alipay': alipay, 'wxhao': wxhao, 'opp': opp},
			dataType: "text",
			
			success: function (d) {
				if (d == "1") {
					
					TopBox.alert("填写成功.", function () { window.location.href = "{php echo $this->mturl('fansindex',array('id'=>$profile['id']))}"; });
					
				} else if (d == "3") {
					TopBox.alert("完善资料成功.", function () { window.location.href = '{php echo $this->mturl('commission', array('op'=>'commapply'))}'; });
				} else if (d == "0") {
					
					TopBox.alert("填写失败.");
				} else {
					
					TopBox.alert("信息填写不正确.");
				}
			},
			
			error: function (xml, text, thrown) {
				TopBox.alert("出错啦!");
			}
		});

	}
});
	
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">

    if(navigator.appName == 'Microsoft Internet Explorer'){
        if(navigator.userAgent.indexOf("MSIE 5.0")>0 || navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0) {
            alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
        }
    }

    // jssdk config 对象
    jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
    // 是否启用调试
    jssdkconfig.debug = false;
    //
    jssdkconfig.jsApiList = [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
    ];

    var wxData = {
        //"appId": "{$_W['account']['key']}",
        "imgUrl" : '{$_W['siteroot']}/source/modules/eso_sale/style/images/icon.jpg',
        "link" : '{php echo $_W['siteroot']."app/".$this->mturl('fansindex',array('id'=>$id))}',
        "desc" : '看你能捞多少佣金',
        "title" : '全民销客-{$_W['account']['name']}'
    };

    wx.config(jssdkconfig);
    wx.ready(function () {
        wx.onMenuShareAppMessage(wxData);
        wx.onMenuShareTimeline(wxData);
        wx.onMenuShareQQ(wxData);
        wx.onMenuShareWeibo(wxData);
    });
</script>
</body>
</html>